package predict.app.ddms;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    Button button = null;
    Button button1 = null;
    Button button2 = null;
    private static final String ACTIVITY_TAG = "MainActivity";
    private static final String LIFT_TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.v(MainActivity.LIFT_TAG, "第一个页面的onCreate");

        button = (Button)findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.v(MainActivity.ACTIVITY_TAG, "这是verbose");
                Log.d(MainActivity.ACTIVITY_TAG, "这是Debug");
                Log.i(MainActivity.ACTIVITY_TAG, "这是Information");
                Log.w(MainActivity.ACTIVITY_TAG, "这是Warning");
                Log.e(MainActivity.ACTIVITY_TAG, "这是Error");
            }
        });

        button1 = (Button)findViewById(R.id.button2);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, second.class);
                MainActivity.this.startActivity(intent);
                finish();
            }
        });

        button2 = (Button)findViewById(R.id.button3);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, second.class);
                MainActivity.this.startActivity(intent);
            }
        });
    }

    @Override
    protected void onDestroy() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onDestory");
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onPause");
        super.onPause();
    }

    @Override
    protected  void onRestart() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onRestart");
        super.onRestart();
    }

    @Override
    protected void onResume() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onResume");
        super.onResume();
    }

    @Override
    protected void onStart() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onStart");
        super.onStart();
    }

    @Override
    protected void onStop() {
        Log.v(MainActivity.LIFT_TAG, "第一个页面的onStop");
        super.onStop();
    }
}
